@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework

@{
    @*
    === Macro Parameters To Create ===
    Show:True   Alias:propertyAlias     Name:Property Alias    Type:Textstring
    *@   
    
    @* Get the content type alias we want to filter on from the macro parameter *@
    var propertyAlias = Model.MacroParameters.propertyAlias;
}


@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@
@if (CurrentPage.Children.Where("umbracoNaviHide != @0", "True").Any())
{
    <ul>            
        @* For each child page under the root node, where the property umbracoNaviHide is not True, order in descending order by the property passed in *@
        @foreach (var childPage in CurrentPage.Children.Where("umbracoNaviHide != @0", "True").OrderBy(propertyAlias))
        {
            <li>
                <a href="@childPage.Url">@childPage.Name</a>
            </li>
        }
    </ul>
}
